<template>
  <div class="f1_content_left">
    <div class="f1_content_left_f1">
      <img src="@/assets/image/组63.png" alt="" v-if="!loginState" />
      <img src="@/assets/image/首页0822/组93.png" alt="" v-else />
      <div class="div">
        <h4>欢迎来到商驿企服数字科技平台</h4>
        <div class="btn" v-if="!loginState">
          <p @click="goLogin">登录</p>
          <p @click="goLoginreg" style="background: #fff; color: #3f6df1">注册</p>
        </div>
        <span v-else>您好，{{ entname == 'null' ? userPhone : entname }}</span>
      </div>
    </div>
    <div class="f1_content_left_f2">
      <div class="f1_content_left_f2_title">
        <img src="@/assets/image/组64.png" alt="" />
        <h4>产品精选</h4>
      </div>
      <div class="f1_content_left_f2_list" v-for="(item, index) in lists" :key="index">
        <div class="productName">
          <h3>{{ item.name }}</h3>
          <button @click="goShangPiao(item.name)">了解详情</button>
        </div>
        <div class="message">
          <ul>
            <li>
              <h2>{{ item.a }}</h2>
              <h4>{{ item.b }}</h4>
            </li>
          </ul>
          <ul>
            <li style="width: 180px">
              <h2>{{ item.c }}</h2>
              <h4>{{ item.d }}</h4>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userPhone: '',
      entname: '',
      loginState: null,
      lists: [
        {
          name: '商票贴现融资',
          a: '最高贴现额度',
          b: '2 亿',
          c: '时效快',
          d: '全线上操作，当日放款'
        },
        {
          name: '关税保函',
          a: '门槛低',
          b: '不占银行授信',
          c: '成本普惠',
          d: '期限和额度灵活选择'
        }
      ]
    }
  },
  mounted() {
    this.entname = sessionStorage.getItem('entname')
    this.userPhone = sessionStorage.getItem('userPhone')
    this.loginState = sessionStorage.getItem('loginState')
  },
  methods: {
    goShangPiao(e) {
      if (e == '商票贴现融资') {
        this.$router.push('/ShangPiao')
        setTimeout(() => {
          this.$router.go(0)
        }, 100)
      } else if (e == '关税保函') {
        this.$router.push('/KuaJing')
        setTimeout(() => {
          this.$router.go(0)
        }, 500)
      }
    },
    //
    // 跳转登录页
    goLogin() {
      this.$router.push('/login')
    },
    // 跳转注册页
    goLoginreg() {
      this.$router.push('/loginreg')
    }
  }
}
</script>

<style lang="scss" scoped>
.f1_content_left {
  z-index: 99;
  box-sizing: border-box;
  padding: 0.2083rem;
  width: 2.4479rem;
  height: 3.151rem;
  background-color: #fff;
  border-radius: 0.0208rem;
  .f1_content_left_f1 {
    width: 100%;
    display: flex;
    width: 100%;
    height: 0.3125rem;
    img {
      width: 0.3021rem;
    }
    .div {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      height: 0.3125rem;
      margin-left: 0.0781rem;
      h4 {
        font-size: 0.1146rem;
        color: #000;
        font-weight: 600;
      }
      .btn {
        display: flex;
        width: 100%;
        height: 0.1302rem;
        p {
          box-sizing: border-box;
          padding: 0.0156rem 0.0313rem;
          cursor: pointer;
          display: flex;
          justify-content: center;
          align-items: center;
          border-radius: 0.0104rem;
          width: 0.3385rem;
          height: 0.1563rem;
          background-color: #3f6df1;
          color: #fff;
          margin-right: 0.0938rem;
          font-size: 0.0781rem;
          border: 0.0052rem solid #3f6df1;
        }
      }
      span {
        font-size: 0.0938rem;
        color: #757da1;
        font-weight: 600;
      }
    }
  }
  .f1_content_left_f2 {
    box-sizing: border-box;
    padding: 0.1563rem 0;
    width: 100%;
    height: 2.3438rem;
    margin-top: 0.2865rem;
    border-top: 0.0052rem solid #999;
    // background-color: rgba(255, 169, 158, 0.5);
    .f1_content_left_f2_title {
      display: flex;
      align-items: center;
      width: 100%;
      height: 0.1563rem;
      img {
        width: 0.125rem;
      }
      h4 {
        color: #000;
        font-weight: 600;
        font-size: 0.1042rem;
        margin-left: 0.0521rem;
      }
    }
    .f1_content_left_f2_list {
      box-sizing: border-box;
      padding: 0.0521rem 0.1042rem;
      width: 1.9583rem;
      height: 0.7813rem;
      background: url(@/assets/image/组305.png) no-repeat;
      // box-shadow: 4px 0px 8px 0px #97a8bc;
      border-radius: 0.0104rem;
      margin-top: 0.1302rem;
      .productName {
        display: flex;
        justify-content: space-between;
        width: 100%;
        height: 0.1302rem;
        h3 {
          font-weight: 600;
          font-family: 'Microsoft YaHei';
          color: rgb(84, 93, 128);
          font-size: 0.1042rem;
        }
        button {
          box-sizing: border-box;
          width: 0.4167rem;
          height: 0.1406rem;
          border-radius: 0.0156rem;
          color: #3f6df1;
          background-color: #ebf5ff;
          font-size: 0.0781rem;
          cursor: pointer;
          border: 0.0052rem solid #3f6df1;
        }
      }
      .productName button:hover {
        color: #fff;
        background-color: #3f6df1;
      }
      .message {
        display: flex;
        width: 100%;
        margin-top: 0.1823rem;
        ul {
          margin-right: 0.1042rem;
          h2 {
            width: 0.7813rem;
            font-size: 0.1042rem;
            font-family: SourceHanSansSC-Medium, SourceHanSansSC;
            font-weight: 600;
            color: #e78f3b;
          }
          h4 {
            margin-top: 0.0521rem;
            color: #aaa;
            font-size: 0.0833rem;
          }
        }
      }
    }
  }
}
::v-deep .el-dialog__header {
  height: 0px;
}
</style>
